N=100;
a=ones(N,2);
a(2,:)=[2,2];
for n=1:N-2
    a(n+2,1)=(a(n+1,1)^2+1)/a(n,1);
    a(n+2,2)=3*a(n+1,2)-a(n,2);
end